package com.eorchis.module.preauthorizationregistration.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;



import org.hibernate.annotations.GenericGenerator;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.module.signupdept.domain.SignupDept;
import com.eorchis.module.user.domain.User;

/**
 * Title: PreAuthorizationRegistration<br>
 * Description: 个人报名预授权实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author Administrator
 * @createDate 2015-01-06
 * @version $Revision$
 */
@Entity
@Table(name = "PRE_AUTHORIZATION_REGISTRATION")
public class PreAuthorizationRegistration implements IBaseEntity {
	private static final long serialVersionUID = 1L;

	private String id;//个人报名预授权ID
	private User user;//用户ID
	private String loginId;//用户登陆ID
	private Integer year;//年份
	private String userName;//用户姓名
	private SignupDept department;//部门

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="ID")
	/**
	 * 设置个人报名预授权ID
	 */		
	public String getId() {
		return id;
	}
	/**
	 * 获取个人报名预授权ID
	 */		
	public void setId(String id) {
		this.id = id;
	}
	@Column(name="YEAR")
	public Integer getYear() {
		return year;
	}
	public void setYear(Integer year) {
		this.year = year;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="USER_ID")	
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@Column(name="LOGIN_ID")
	/**
	 * 设置用户登陆ID
	 */		
	public String getLoginId() {
		return loginId;
	}
	/**
	 * 获取用户登陆ID
	 */		
	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}
	@Column(name="USER_NAME")
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	/**
	 * 获取部门
	 */
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="DEPID", referencedColumnName = "DEPID")
	public SignupDept getDepartment() {
		return department;
	}
	/**
	 * 设置部门
	 */
	public void setDepartment(SignupDept department) {
		this.department = department;
	}
	/**
	 * 记录日志使用
	 */
	public String toString() {
		return "个人报名预授权ID======>" + getId()+"\n用户登陆ID======>" + getLoginId();
	}
}
